﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BDPAutodetect.Device;
using CommunityToolkit.Mvvm.ComponentModel;
using static System.Collections.Specialized.BitVector32;

namespace BDPAutodetect.Models
{
    /// <summary>
    /// 工位视图模型数据
    /// </summary>
    public partial class MStation : MBasic
    {
        /// <summary>
        /// 工位类型
        /// </summary>
        [ObservableProperty]
        protected DeviceStationType stationType;

        /// <summary>
        /// 构造函数
        /// </summary>
        public MStation() : base()
        {
            this.Code = "None";
            this.Name = "未知";
            this.StationType = DeviceStationType.None;
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        public MStation(int argID, string argCode, string argName) : base()
        {
            this.ID = argID;
            this.Code = argCode;
            this.Name = argName;
            this.StationType = DeviceStationType.None;
        }

        /// <summary>
        /// 深度克隆
        /// </summary>
        public override MStation CloneDeep()
        {
            return new MStation(this.ID, this.Code, this.Name)
            {
                StationType = this.StationType
            };
        }

        /// <summary>
        /// 克隆数据表
        /// </summary>
        /// <returns></returns>
        public TBasicStation CloneTData()
        {
            return new TBasicStation()
            {
                ID = this.ID,
                Code = this.Code,
                Name = this.Name
            };
        }
    }
}
